// 引入
import Vue from "vue";
import VueRouter from "vue-router";

// 使用插件
Vue.use(VueRouter);

// 创建对象
const router = new VueRouter({
    mode:'history',
    routes:[
        {
            path:'',
            redirect:'home'
        },
        {
            path:'/home',
            component: ()=> import('../views/home/home.vue')
        },
        {
            path:'/cate',
            component: ()=> import('../views/cate/cate.vue')
        },
        {
            path:'/cart',
            component: ()=> import('../views/cart/cart.vue')
        },
        {
            path:'/user',
            component: ()=> import('../views/user/user.vue')
        },
    ]
})

// 导出VueRouter
export default router